package com.hqyj.finance.server.users.financeusers.entity;

import org.apache.ibatis.type.JdbcType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("users")
@Table(name="users")

public class Users extends BaseEntity{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Integer uid; //用户主键
    private String username; //用户名

    private String realName; //用户真实姓名
    private String password; //密码
    private String mobile; //手机
    private String email; //电子邮箱
    private String gender; //性别

    private String birthday; //出生日期
    private String idCard; //身份证号码

    private String province ; //省份

    private String provinceCode;
    private String city; // 城市
    private String cityCode;
    private String zone; //区县
    private String zoneCode;
    private String street; //街道

    private String avatar; //阿凡达，avatar

    @Transient //这个字段我不参与持久化...
    @TableField(exist = false,jdbcType = JdbcType.BLOB,typeHandler = FastjsonTypeHandler.class)
    private List<String> roles; //用户的角色集合；

    @Transient //这个字段我不参与持久化...
    @TableField(exist = false,jdbcType = JdbcType.BLOB,typeHandler = FastjsonTypeHandler.class)
    private List<Roles> rolesList;

}
